package org.yzz.auth.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yzz.auth.domain.Permission;
import org.yzz.auth.mapper.PermissionMapper;
import org.yzz.auth.query.PermissionQuery;
import org.yzz.auth.service.IPermissionService;
import org.yzz.base.utils.PageInfo;
import org.yzz.org.domain.Department;

import java.util.List;

@Service
public class PermissionServiceImpl implements IPermissionService {
    @Autowired
    private PermissionMapper mapper;
    @Override
    public PageInfo<Permission> queryPage(PermissionQuery permissionQuery) {
        Integer total = mapper.countTotal(permissionQuery);
        if(total==0) return new PageInfo<>();
        List<Permission> permissions = mapper.queryPage(permissionQuery);
        return new PageInfo<>(total,permissions);
    }

    @Override
    public List<Permission> queryPermission() {
        return mapper.queryPermission();
    }
}
